<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Formulario Busqueda</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />
<link href="Estilos/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>
<script src="include_js/jquery.autocomplete.js" type="text/javascript"></script>
<style>
.borde
{
	border:1px solid #6593C0;
}
.texto
{
	color:#FFFFFF; font-weight:bold;
}
</style>
</head>

<body>
<form name="form_Busqueda" id="form_Busqueda" method="post">
<table width="100%" border="0" cellpadding="0">
  <tr>
  <td><div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Secci&oacute;n de b&uacute;squeda "Facturas de Proveedores".</label></div>
  	<div class='groupbox'>
	<table width="100%" border="0" class="tres" cellpadding="0" cellspacing="0">
  	<tr>
		<td width="29%" class="borde"><label class="texto">Tipo Documento</label></td>
		<td width="19%" class="borde"><label class="texto">Fecha Desde</label></td>
		<td width="21%" class="borde"><label class="texto">Fecha Hasta</label></td>
		<td width="31%" class="borde">&nbsp;</td>
  	</tr>
  	<tr>
    	<td class="borde"><select name="cmb_Documento" id="cmb_Documento">
        <option value="1">FACTURA</option>
        <option value="2">FACTURA EXENTA</option>
        <option value="3">FACTURA ELECTRONICA</option>
      </select></td>
    	<td class="borde"><input name="txtFIni" type="text" id="txtFIni" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFIni, form_Busqueda.txtFIni, 'dd-mm-yyyy');" /></td>
    	<td class="borde"><input name="txtFFin" type="text" id="txtFFin" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFFin, form_Busqueda.txtFFin, 'dd-mm-yyyy');" /></td>
    	<td class="borde"><input type="button" name="btn_Buscar" id="btn_Buscar" value=" " class="buscar" /></td>
  	</tr>
  	<tr>
  	  <td class="borde"><label class="texto">Proveedor</label></td>
  	  <td class="borde">&nbsp;</td>
  	  <td class="borde">&nbsp;</td>
  	  <td class="borde">&nbsp;</td>
	  </tr>
  	<tr>
  	  <td class="borde" colspan="3"><select name="cmb_Proveedor" id="cmb_Proveedor">
         <option value="0">--PROVEEDOR--</option>
		  <?php
            	$con = new Conexion();
        		$con2 = $con->conexionBD("fpproduccion");
                $sql = "select ProvRut,ProvNombre from Proveedor order by ProvNombre";
                $resultado = mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
				while ($row = mysql_fetch_row($resultado))
				{
					$nombre = utf8_decode($row[1]);
					echo "<option value='".$row[0]."'>".$nombre."</option>";
				}
                $con->cerrarBD();
		?>
      </select></td>
  	  <td class="borde">&nbsp;</td>
	  </tr>
</table>
</div>
  </td>
  </tr>
</table>
</form>
<table border="0" cellpadding="0" cellspacing="2" width="100%">
<tr><td><div id="capa"></div></td></tr>
</table>
</body>
<script>
$('#btn_Buscar').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Contabilidad/Carga_Busqueda_FacProv.php',
            data: $('#form_Busqueda').serialize(),
            success: function(data) {
                $('#capa').html(data);
            }
        })
});
</script>
</html>